<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%case_galleries}}".
 *
 * @property string $case_id 案例 ID
 * @property string $file 图片
 */
class CaseGalleries extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%case_galleries}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['case_id', 'file'], 'required'],
            [['case_id'], 'integer'],
            [['file'], 'string', 'max' => 255],
            [['case_id', 'file'], 'unique', 'targetAttribute' => ['case_id', 'file']],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'case_id' => '案例 ID',
            'file' => '图片',
        ];
    }
}
